/*
 * @Descripttion:
 * @Author: cxbks
 * @Date: 2021-09-14 16:05:13
 */
package cxbks.java.dao.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * @Author:
 * @CreateTime: 2021-09-13 16:41
 * @Description:用户基础信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//操作的集合为:user
@Document(collection = "user")
public class User {

	@Id
	private String id;

	/**
	 * 昵称
	 */
	private String nickName;

	/**
	 * 头像
	 */
	private String avatar;

	/**
	 * 更多信息
	 */
	private String more;

	/**
	 * 创建时间
	 */
	@CreatedDate
	//局部时间格式化
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	/**
	 * 更新时间
	 */
	@LastModifiedDate
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updateTime;
}
